package com.jet.rtdb;

import com.jet.rtdb.socket.server.RtdbServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @Author: zhangkaifeng.
 * @CreateTime: 2017/8/22 16:19
 * @Description:
 */

@Component
public class EsListener implements ApplicationListener<ApplicationReadyEvent> {

    @Autowired
    RtdbServer rtdbServer;

    @Override
    public void onApplicationEvent(final ApplicationReadyEvent event) {
        try {
            rtdbServer.run();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
